#pragma once
#include <boost/array.hpp>

namespace he
{
	//! Ammunition properties.
	class Ammo : boost::noncopyable
	{
		// Typedefs
	private:
		typedef boost::array<unsigned short, 5> PenetrationArray_t;
		typedef std::pair<unsigned short, unsigned short> RangePair_t;

		// Attributes
	private:
		//! Type/caliber of ammo.
		std::string const m_Type;
		//! Weight in kg.
		float const m_Weight;
		//! Velocity in m/s.
		float const m_Velocity;
		//! Penetration table (valued in mm) for 100, 500, 1000, 1500, 2000 meters range.
		PenetrationArray_t m_PenetrationTable;

		// Operations
	public:
		//! Get penetration value for given range.
		unsigned short get_penetration(unsigned short Range) const;
	private:
		//! Get nearest value range index to penetration table.
		RangePair_t const get_nearest_range(unsigned short Range) const;
		//! Get penetration value from penetration table for given range.
		unsigned short get_penetration_value(unsigned short Range) const;

		// Construction/Destruction
	public:
		Ammo(std::string const &Type, float Weight, float Velocity, unsigned short Penetration100, unsigned short Penetration500, unsigned short Penetration1000, unsigned short Penetration1500, unsigned short Penetration2000);
	};
} /*he*/
